#include "addscreendialog.h"
#include "ui_addscreendialog.h"

AddScreenDialog::AddScreenDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddScreenDialog)
{
    ui->setupUi(this);
    ui->comboBox_screen_type->insertItems(0, screen_type_list);
}

AddScreenDialog::~AddScreenDialog()
{
    delete ui;
}

void AddScreenDialog::on_pushButton_ok_clicked()
{
    accept();
}

void AddScreenDialog::on_pushButton_cancel_clicked()
{
    reject();
}

int AddScreenDialog::showAndGetResult()
{
    if (this->exec() == QDialog::Accepted)
    {
        if (ui->comboBox_screen_type->currentText() == "左板式")
            return 1;
        if (ui->comboBox_screen_type->currentText() == "图片全屏紧急信息")
            return 10;
        if (ui->comboBox_screen_type->currentText() == "文本全屏紧急信息")
            return 11;
    }
    return 0;
}
